public class nvcutr {
    public static void main(String[] args) {

        int[] arr = new int[5];
        for (int i = 0,dest = -1; i < arr.length; i++) {
            if(arr[i]  != 0){
                dest++;
                int a = arr[i];
              arr[i] = arr[dest];
              arr[dest] = a;
            }
        }
    }
}
